from django import forms
from common.utils.custom_form_field import JsonArrayDateField, JsonArrayField


class GeneralReport(forms.Form):
    target_event_id = forms.CharField()
    chn_filter_list = JsonArrayField(required=False)


class OpUserAnalysisForm(forms.Form):
    # TODO merge_by_interval_type --> merge_report
    time_range = JsonArrayDateField()
    user_type = forms.CharField(required=False)
    interval_type = forms.CharField(required=False)
    chn_filter_list = JsonArrayField(required=False)
    chn_device_type = forms.CharField(required=False)
    merge_by_interval_type = forms.IntegerField(required=False)
    sort_by = forms.CharField(required=False)
    size = forms.IntegerField(required=False)
    page = forms.IntegerField(required=False)
    to_export_file = forms.IntegerField(required=False)


class RechargeAnalysisForm(forms.Form):
    # TODO merge_by_interval_type --> merge_report
    time_range = JsonArrayDateField()
    time_interval_type = forms.CharField(required=False)
    chn_filter_list = JsonArrayField(required=False)
    merge_by_interval_type = forms.IntegerField(required=False)
    user_type = forms.CharField(required=False)
    sort_by = forms.CharField(required=False)
    size = forms.IntegerField(required=False)
    page = forms.IntegerField(required=False)
    to_export_file = forms.IntegerField(required=False)


class DailyAnalysisForm(forms.Form):
    time_range = JsonArrayDateField()
    sort_by = forms.CharField(required=False)
    size = forms.IntegerField(required=False)
    page = forms.IntegerField(required=False)
    to_export_file = forms.IntegerField(required=False)


class WithdrawAnalysisForm(forms.Form):
    # TODO merge_by_interval_type --> merge_report
    time_range = JsonArrayDateField()
    user_type = forms.CharField(required=False)
    time_interval_type = forms.CharField(required=False)
    chn_filter_list = JsonArrayField(required=False)
    pay_channel_list = JsonArrayField(required=False)
    merge_by_interval_type = forms.IntegerField(required=False)
    sort_by = forms.CharField(required=False)
    size = forms.IntegerField(required=False)
    page = forms.IntegerField(required=False)
    to_export_file = forms.IntegerField(required=False)
